﻿using IcicleFramework.Components.Actions;
using IcicleFramework.Components.Physics;
using Microsoft.Xna.Framework;

namespace ExampleGame.Components.Actions
{
    public class BallImpulseAction : TimedAction
    {
        protected override void Execute(GameTime gameTime)
        {
            var physics = ParentGameObject.GetComponent<IPhysicsComponent>();
            var impulse = (Vector2) ActionData["impulse"];

            physics.ApplyImpulse(impulse);

            base.Execute(gameTime);
        }
    }
}
